package com.sanjiahantang.youjiaclient.module.me.scheme.models.impl;

import android.content.Context;

import com.sanjiahantang.youjiaclient.base.BaseBean;
import com.sanjiahantang.youjiaclient.base.CallBack;
import com.sanjiahantang.youjiaclient.config.ConfigValue;
import com.sanjiahantang.youjiaclient.http.BaseDelegate;
import com.sanjiahantang.youjiaclient.http.OkHttpClientManager;
import com.sanjiahantang.youjiaclient.module.common.beans.StringBean;
import com.sanjiahantang.youjiaclient.module.me.scheme.beans.MeCaseOBean;
import com.sanjiahantang.youjiaclient.module.me.scheme.models.IMeSchemeModel;
import com.squareup.okhttp.Request;

import java.util.Map;


/**
 * Created by zy on 2017/9/5.
 */

public class MeSchemeModel implements IMeSchemeModel {

    //我的方案明细id
    @Override
    public void loadMeCaseById(final Context context, Map<String, String> param, final CallBack<MeCaseOBean> callBack) {

        OkHttpClientManager.postAsyn(context, ConfigValue.API_URL + "/project/phone/plan/searchProjectPricePhone",param,new BaseDelegate.ResultCallback<MeCaseOBean>() {

            @Override
            public void onError(Request request, Object tag, Exception e) {
                callBack.onFailure(e.getMessage());
            }

            @Override
            public void onResponse(MeCaseOBean response, Object tag) {
                callBack.onSuccess(response,context, tag);
            }
        });
    }

    @Override
    public void addCollectInfo(final Context context, Map<String, Object> param, final CallBack<BaseBean> callBack) {
//        OkHttpClientManager.postJson(context, ConfigValue.API_URL + "/mall/collect/phone/customer/addCollectInfo",param,new BaseDelegate.ResultCallback<DesignerBean>() {
//
//            @Override
//            public void onError(Request request, Object tag, Exception e) {
//                callBack.onFailure(e.getMessage());
//            }
//
//            @Override
//            public void onResponse(DesignerBean response, Object tag) {
//                callBack.onSuccess(response,context, tag);
//            }
//        });
    }

    @Override
    public void deleteCollectInfo(final Context context, Map<String, Object> param, final CallBack<BaseBean> callBack) {
//        OkHttpClientManager.postJson(context, ConfigValue.API_URL + "/mall/collect/phone/customer/deleteCollectInfo",param,new BaseDelegate.ResultCallback<DesignerBean>() {
//
//            @Override
//            public void onError(Request request, Object tag, Exception e) {
//                callBack.onFailure(e.getMessage());
//            }
//
//            @Override
//            public void onResponse(DesignerBean response, Object tag) {
//                callBack.onSuccess(response,context, tag);
//            }
//        });
    }
    //检查是否下单
    @Override
    public void loadCheckOrder(final Context context, Map<String, String> param, final CallBack<StringBean> callBack) {

        OkHttpClientManager.postAsyn(context, ConfigValue.API_URL + "/project/price/phone/customer/findIsPlaceAnOrder",param,new BaseDelegate.ResultCallback<StringBean>() {

            @Override
            public void onError(Request request, Object tag, Exception e) {
                callBack.onFailure(e.getMessage());
            }

            @Override
            public void onResponse(StringBean response, Object tag) {
                callBack.onSuccess(response,context, tag);
            }
        });

    }
}
